/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dbhandler;


import entityclasses.event;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.sql.*;
import java.util.logging.Logger;
/**
 *
 * @author Swami
 */
public class eventview {
    public String abc(){
        return "hi";
    }
    public ResultSet rs;
    public ArrayList eventviewquery() throws SQLException{
    String Query;
        
        
        Query = "Select * from tbl_event";
              
        DBConnection db = new DBConnection();
        ArrayList<event> arr=new ArrayList<event>();
        db.connect();
        try {
           rs=db.customQuery(Query);
           
           
             
            while(rs.next())
            {
                event evt=new event();
                evt.setEvent_id(Integer.parseInt(rs.getString(0)));
                evt.setAccess_type(Integer.parseInt(rs.getString(1)));
                evt.setType_id(Integer.parseInt(rs.getString(2)));
                evt.setPostedDt(rs.getString(3));
                
               arr.add(evt);
                
            }
           
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
        db.disconnect();
        
        
      return arr;
    }
    public static void main(String args[])
    {
        
             eventview event=new eventview();   
       
       try{
            
      
      
       
           // newusr.newuserregquery();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
}

